package com.ruoyi.system.domain;

import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 楼对象 sys_building
 * 
 * @author ruoyi
 * @date 2024-08-07
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Data
public class SysBuilding extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 楼id */
    private Long buildingId;

    /** 楼号 */
    @Excel(name = "楼号")
    private String buildingNo;

    /** 楼名称 */
    @Excel(name = "楼名称")
    private String buildingName;

    /** 部门id */
    @Excel(name = "部门id")
    private Long deptId;

    /** 小区id */
    @Excel(name = "小区id")
    private Long housingId;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    @Excel(name = "用户名")
    private String userName;

    /** 楼地址 */
    @Excel(name = "楼地址")
    private String address;

    /** 楼类型 1=别墅 2=普通住宅 3=公寓 4=民房 */
    @Excel(name = "楼类型 1=别墅 2=普通住宅 3=公寓 4=民房")
    private String buildType;

    /** 价格类型 供暖费类型（1：居民 2：非居民）*/
    private String priceType;

    /** 取暖费单价 */
    @Excel(name = "取暖费单价")
    private BigDecimal price;

    /** 总价 */
    @Excel(name = "总价")
    private BigDecimal totalPrice;

    /** 建筑面积 */
    @Excel(name = "建筑面积")
    private BigDecimal area;

    /** 单元 */
    @Excel(name = "单元")
    private Integer unit;

    /** 楼层 */
    @Excel(name = "楼层")
    private Integer floor;

    /** 门牌 */
    @Excel(name = "门牌")
    private Integer door;

    /** 楼状态（0正常 1停用） */
    @Excel(name = "楼状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 热水费模板id */
    private Long heatFeeId;

    /** 热费单价 */
    private BigDecimal heatPrice;

    /** 设备id */
    private Long deviceId;
    private String deviceCode;

    /** 热费总额 */
    private BigDecimal totalFee;

    /** 累计热量 */
    private Double heatQuantity;
    /** 统计时间 */
    private Date beginDate;
    private Date endDate;
    /** 累计热量,减去初始值 */
    private BigDecimal subHeatQuantity;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("buildingId", getBuildingId())
            .append("buildingNo", getBuildingNo())
            .append("buildingName", getBuildingName())
            .append("deptId", getDeptId())
            .append("housingId", getHousingId())
            .append("userId", getUserId())
            .append("address", getAddress())
            .append("buildType", getBuildType())
            .append("price", getPrice())
            .append("totalPrice", getTotalPrice())
            .append("area", getArea())
            .append("unit", getUnit())
            .append("floor", getFloor())
            .append("door", getDoor())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }

    public String getBatchKey(Long deptId){
        return deptId+"-"+ getHousingId();
    }

    public String getBuildKey(Long deptId){
        return deptId+"-"+ getHousingId()+"-"+getBuildingNo();
    }
}
